package com.tanhua.server.controller;

import com.tanhua.server.service.PeachBlossomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/peachblossom")
public class PeachBlossomController {

    @Autowired
    private PeachBlossomService peachBlossomService;

    /**
     * 发送语言
     */
    @PostMapping
    public Object sendVoice(@RequestParam("soundFile") MultipartFile soundFile) {
        return this.peachBlossomService.sendVoice(soundFile);
    }

    /**
     * 接受语言
     * @return 语音
     */
    @GetMapping
    public Object receiveVoice() {
        return this.peachBlossomService.receiveVoice();
    }
}